import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class forfo {
    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("1");
        set.add("21");
        set.add("13");
        set.add("1123");
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()){
            String it = iterator.next();
            System.out.println(it);
        }
        System.out.println("--------------------------");
        Iterator<String> iterator1 = set.iterator();
        while (iterator1.hasNext()){
            String next = iterator1.next();
            System.out.println(next);
        }
    }
    public static <E>ArrayList<E> method(ArrayList<E> list,E t1,E t2,E t3){
        list.add(t1);
        list.add(t2);
        list.add(t3);
        return list;
    }
}

